<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" th:href="@{/bootstrap.min.css}">
    <script th:src="@{/jquery-3.3.1.slim.min.js}"></script>
    <script th:src="@{/popper.min.js}"></script>
    <script th:src="@{/bootstrap.min.js}"></script>
    <script th:src="@{/vue.js}"></script>
    <script th:src="@{/axios.min.js}"></script>
</head>
<body>
<div class="container">
    <form class="login-form" method="post" th:action="@{/admin/loginAdmin}">
        <div class="form-group">
            <img src="https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3034193002,1294516503&fm=26&gp=0.jpg"
                 alt="头像" class="avatar">
        </div>
        <div class="form-group">
            <label for="exampleInputEmail1">用户名</label>
            <input type="text" class="form-control" name="username" id="exampleInputEmail1" aria-describedby="emailHelp"
                   placeholder="用户名">
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">密码</label>
            <input type="password" name="password" class="form-control" id="exampleInputPassword1" placeholder="密码">
        </div>
        <div class="form-check" th:if="${false}">
            <input type="checkbox" class="form-check-input" id="exampleCheck1">
            <label class="form-check-label" for="exampleCheck1">记住我</label>
        </div>
        <button @click="login" class="btn btn-primary btn-login">登录</button>
    </form>
</div>
<script>
    let form = $(".login-form").serialize();
    let success = "https://we9.91gongju.cn:10000/release-work/admin/work";
    new Vue({
        el: ".container",
        data() {
            return {
                baseUrl: "https://we9.91gongju.cn:10000"
                //baseUrl: "https://localhsot:10000"
            }
        },
        methods: {
            login() {
                axios.post(`https://we9.91gongju.cn:10000/admin/loginAdmin`, form).then(response => window.location.replace("https://we9.91gongju.cn:10000/release-work/admin/work"));
            }
        }
    })
</script>
</body>
<style>
    .btn-login {
        width: 100%;
        height: 38px;
        text-align: center;
        line-height: 15px;
        margin-top: 20px;
    }

    .login-form {
        margin: 10% 35%;
    }

    .avatar {
        width: 100px;
        height: 100px;
        border: 0;
        border-radius: 50%;
        margin-left: 32%;
    }
</style>
</html>
